package Animal;

import Interface.DebugMassage;

public abstract class Animal implements DebugMassage {
    protected String animalName;
    protected int animalNumber;

    protected abstract String GetAnimalType();

    public Animal(String _newName, int _newNumber) {
        this.SetAnimalName(_newName);
        this.SetAnimalNumber(_newNumber);
    }

    public String GetAnimalName() {
        return animalName;
    }

    public int GetAnimalNumber() {
        return animalNumber;
    }

    public void SetAnimalNumber(int _newNumber) {
        animalNumber = _newNumber;
    }

    protected void SetAnimalName(String _newName) {
        animalName = _newName;
    }

    public String GetDebugMassage() {
        return GetAnimalType() + ":" + this.animalName + "\t有" + this.animalNumber + "只\n";
    }
}
